Dynamic filtering with Rules search.
color
facet if the query contains the word “red”.
Using the example dataset, this rule ensures that only records with “red” in the color
attribute are returned. It ignores “red” in other attributes such as brand
.
Query | Results |
---|---|
red | FM, Clothing, LondonLook, Red, 21.99 The Mandal, Toaster, Black & Decker, Red, 149.99 |
{"filters":"color:red"}
filters
parameter.
With this approach, you need one rule per filter value.
If you have 10 color options, you need 10 rules, one for each color.
color
facet.
Using the example dataset, this single rule ensures that any record with any matching color value in the color
attribute will be returned.
Query | Results |
---|---|
red | FM, Clothing, LondonLook, Red, 21.99 The Mandal, Toaster, Black & Decker, Red, 149.99 |
black | Will Carpenter, T-shirt, Red or Dead, Black, 199.99 |
product_type
“Toaster” and includes the phrase “800w” is returned.
Query | Results |
---|---|
cheap toaster 800w | Essentials 800w, Toaster, Daewoo, Black, 14.99 |
{"filters":"product_type:toaster"}
{"filters":"price < 10"}
brand
attribute matches “apple”.
You can find this behavior on sites such as GitHub.
It’s a great alternative to filters for users who prefer to type rather than click.
This approach is similar to one rule per facet.
Using the example dataset, this rule ensures that any record containing the phrase “headphones” that also has “Apple” in the brand
attribute will be returned. It won’t return non-Apple brands, even if the phrase “Apple” appears in other attributes.
Query | Results |
---|---|
apple headphones | Airpods Max, Headphones, Apple, Gray, 548.99 |
{facet:brand}
.